﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace SLBehaviourSystem
{
    [ActionComponent]
    public class MoveToPosComponent : MoveComponent
    {
        public Vector3 Target;
        protected override void OnInit()
        {
            base.OnInit();
        }

        protected override void Move(float speed, float distanceOffset)
        {
            bool isEnd = MoveHelper.MoveToPos(gameObject, Target, speed, distanceOffset, MoveType.CharacterController);
            if (isEnd)
            {
                enabled = false;
                OnExcuted(BehaviourNodeState.Success);
            }
            else
            {

            }
        }
    }
}